W32: Fix double-arrowed combobox button
authorРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 25 Mar 2014 17:25:47 +0000 (17:25 +0000)
committerРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 1 Apr 2014 03:29:35 +0000 (03:29 +0000)
The arrow is part of the background image drawn by the theme, don't draw
GTK's own arrow. This also applies to non-entry comboboxes.

On XP the arrow-and-nothing-else part does not exist (W32 XP theme draws a
white rectangle) and has to be subtituted for a simple dropdown button even
for non-entry comboboxes.

https://bugzilla.gnome.org/show_bug.cgi?id=727035

gtk/resources/theme/gtk-win32-base.css
gtk/resources/theme/gtk-win32-xp.css

index a845769cc497cb539b72463482aea1bb86eac8ce..a76c994830804b7635c103246f8929e355c48e79 100644 (file)
@@ -744,6 +744,41 @@ GtkComboBox .separator {
     -GtkWidget-vertical-separator: 0;
 }
 
+/* Draw "arrow" for non-entry comboboxes. Select the box, since selecting
+   the arrow itself does not seem to work as intended. */
+GtkComboBox GtkBox {
+    color: rgba(255, 0, 0, 0);
+    background-image: -gtk-win32-theme-part(combobox, 6 1);
+}
+GtkComboBox GtkBox:insensitive {
+    color: rgba(255, 0, 0, 0);
+    background-image: -gtk-win32-theme-part(combobox, 6 4);
+}
+/* Make sure the style above does not touch comboboxes with entries by
+   disabling background image for the box again */
+GtkComboBox.combobox-entry GtkBox {
+    color: rgba(255, 0, 0, 0);
+    background-image: none;
+}
+GtkComboBox.combobox-entry GtkBox:insensitive {
+    color: rgba(255, 0, 0, 0);
+    background-image: none;
+}
+/* The arrow is part of the background image drawn by the theme, don't draw GTK's own arrow */
+GtkComboBox.combobox-entry GtkArrow {
+    color: rgba(255, 0, 0, 0);
+}
+GtkComboBox.combobox-entry GtkArrow:insensitive {
+    color: rgba(255, 0, 0, 0);
+}
+GtkComboBox GtkArrow {
+    color: rgba(255, 0, 0, 0);
+}
+GtkComboBox GtkArrow:insensitive {
+    color: rgba(255, 0, 0, 0);
+}
+
+
 /* Notebook */
 
 .notebook {
index 70ee8628d53b511eae3a45c6b1590e9bdcfb0750..c1788a22b0a532f7f6c8b61a7cbf083e4cfb5e4b 100644 (file)
@@ -1,5 +1,15 @@
 @import url("gtk-win32-base.css");
 
+/* Override non-entry combobox arrow parts from the base theme,
+   since XP draws an empty white rectangle for parts 6 1 and 6 4.
+   Draw parts 1 1 and 1 4 instead */
+GtkComboBox GtkBox {
+    background-image: -gtk-win32-theme-part(combobox, 1 1, margins (1 0 1 0));
+}
+GtkComboBox GtkBox:insensitive {
+    background-image: -gtk-win32-theme-part(combobox, 1 4, margins (1 0 1 0));
+}
+
 .menubar {
     background-color: #f7f7f7;
     /*background-color: -gtk-win32-color(button, 30);*/